<script setup>
// import { useSidebarStore } from '@/stores/index'
defineProps({
  userMenu: {
    default() {
      return []
    }
  }
})
</script>
<template>
  <template v-for="menu in userMenu" :key="menu._id">
    <el-sub-menu
      v-if="
        menu.children &&
        menu.children.length > 0 &&
        menu.children[0].menuType == 1
      "
      :index="menu.path"
    >
      <template #title>
        <el-icon><Grid /></el-icon>
        <span>{{ menu.menuName }}</span>
      </template>
      <TreeMenu :userMenu="menu.children"></TreeMenu>
    </el-sub-menu>
    <el-menu-item
      v-else-if="menu.menuType == 1"
      :index="menu.path"
    >
      <template #title>
        <span>{{ menu.menuName }}</span>
      </template>
    </el-menu-item>
  </template>
</template>
<style lang="scss"></style>
